package school.main;

import java.util.HashMap;
import java.util.List;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import school.domain.School;
import school.domain.Student;
import school.model.dao.SchoolDAO;
import school.model.dao.StudentDAO;
import aop.common.model.dao.SearchKeywordCountDAO;

public class TestMain {

	public static void main(String[] args) {
		//SchoolDAO를 스프링컨테이너로 부터 주입받는다.		
		ApplicationContext ctx = 
				new ClassPathXmlApplicationContext("school/config/spring/school-spring.xml");
		SchoolDAO schoolDAO = (SchoolDAO)ctx.getBean("schoolDAOImpl");
		StudentDAO studentDAO = (StudentDAO)ctx.getBean("studentDAOImpl");
		SearchKeywordCountDAO keywordDAO = (SearchKeywordCountDAO)ctx.getBean("searchKeywordCountDAOImpl");
		
		
		School ret =schoolDAO.selectSchoolById(100);
//		ret =schoolDAO.selectSchoolById(100);
//		ret =schoolDAO.selectSchoolById(100);
//		ret =schoolDAO.selectSchoolById(200);
//		ret =schoolDAO.selectSchoolById(200);
//		ret =schoolDAO.selectSchoolById(500);
//		ret =schoolDAO.selectSchoolById(500);
//		ret =schoolDAO.selectSchoolById(200);
//		ret =schoolDAO.selectSchoolById(200);
//		ret =schoolDAO.selectSchoolById(300);
		
		List<School> schList = schoolDAO.selectSchoolByName("김철수");
//		schList = schoolDAO.selectSchoolByName("김철수");
//		schList = schoolDAO.selectSchoolByName("김철수");
//		schList = schoolDAO.selectSchoolByName("김영희");
//		schList = schoolDAO.selectSchoolByName("김철수");
//		schList = schoolDAO.selectSchoolByName("김순이");
		
//		schList = schoolDAO.selectSchoolByAddress("서울");
//		schList = schoolDAO.selectSchoolByAddress("부산");
//		schList = schoolDAO.selectSchoolByAddress("대전");
//		schList = schoolDAO.selectSchoolByAddress("광주");
//		schList = schoolDAO.selectSchoolByAddress("울산");
		
		Student stuTO = studentDAO.selectStudentById("stu-5");
//		stuTO = studentDAO.selectStudentById("stu-2");
//		stuTO = studentDAO.selectStudentById("stu-5");
//		stuTO = studentDAO.selectStudentById("stu-5");
//		stuTO = studentDAO.selectStudentById("stu-1");
//		stuTO = studentDAO.selectStudentById("stu-1");
//		stuTO = studentDAO.selectStudentById("stu-5");
		
		List<Student> stuList = studentDAO.selectStudentByAddress("서울");
//		stuList = studentDAO.selectStudentByAddress("서울");
//		stuList = studentDAO.selectStudentByAddress("서울");
//		stuList = studentDAO.selectStudentByAddress("대전");
//		stuList = studentDAO.selectStudentByAddress("울산");
		
		System.out.println("-----------지금까지 조회한 키워드들----------");
		List<HashMap> keywordList = keywordDAO.selectKeywordList();
		for(HashMap map : keywordList){
			System.out.println(map);
		}
	}
}









